Skip to content

Configure providers per environment - #4548

Open
colonelpanic8 wants to merge 2 commits into
pingdotgg:mainfrom
colonelpanic8:feature/provider-environment-settings
Open

Configure providers per environment#4548
colonelpanic8 wants to merge 2 commits into
pingdotgg:mainfrom
colonelpanic8:feature/provider-environment-settings

Conversation

@colonelpanic8

@colonelpanic8 colonelpanic8 commented Jul 26, 2026

Copy link
Copy Markdown

What Changed

  • Added an environment selector to Provider settings.
  • Routed provider configuration, status refreshes, updates, and new instances to the selected environment.
  • Defaulted managed deployments to the primary environment and client-only deployments to the active/first available environment.
  • Added safe loading and no-environment states plus focused environment-selection tests.

Why

Provider settings were implicitly tied to the primary server. In client-only mode, or when multiple T3 environments are connected, that made it impossible to see which machine owned an account configuration and could route updates to the wrong target.

UI Changes

Before After
Provider settings before Environment-scoped provider settings
Mobile-width verification

Environment-scoped provider settings at 390px

The real add-instance flow was exercised against the selected environment. The resulting provider instance was persisted to that environment and the confirmation toast named the target environment.

Checklist

  • vp check
  • vp test run src/components/settings/SettingsPanels.logic.test.ts src/hooks/useSettings.test.ts --project unit (13 tests)
  • Type-aware lint and type checking for the five changed files
  • Integrated desktop and 390px web verification with zero browser errors or warnings
  • vp run typecheck — blocked by pre-existing @effect/vitest export errors in oxlint-plugin-t3code; clean origin/main fails with the same errors

Note

Medium Risk
Changes where provider accounts are read and written across environments, which could mis-route updates if selection logic is wrong; the reduced cleanup on delete/reset may leave orphaned model prefs or favorites for removed instances.

Overview
Provider settings are no longer tied to the primary server only. The Providers panel adds an environment selector so reads, edits, refreshes, and one-click provider updates target the chosen connected environment, with loading and “no environments” empty states.

resolveProviderSettingsEnvironmentId picks the effective environment: explicit selection, then primary (managed), then active/first available (client-only), with fallback when a stale selection disappears. AddProviderInstanceDialog now requires environmentId / environmentLabel and persists new instances via per-environment settings; success copy names the environment.

Deleting a custom instance or resetting a default provider only updates providerInstances (and legacy providers on reset)—it no longer strips providerModelPreferences or favorites in the same patch.

Reviewed by Cursor Bugbot for commit be176c3. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Scope provider settings and instance management to a selected environment

  • Provider settings are now resolved and displayed per environment using a new ProviderSettingsEnvironmentPanel component in SettingsPanels.tsx, replacing the previous primary-settings-only approach.
  • A new ProviderEnvironmentSelector component in ProviderEnvironmentSelector.tsx lets users switch the active environment for provider configuration.
  • Environment resolution logic is extracted into resolveProviderSettingsEnvironmentId in SettingsPanels.logic.ts, which handles fallback to primary or active environment when no explicit selection exists.
  • AddProviderInstanceDialog now accepts environmentId and environmentLabel props and stores new instances against the selected environment.
  • Behavioral Change: Deleting provider instances or reverting default providers no longer automatically removes favorites.

Macroscope summarized be176c3.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 64fd4ada-dacc-48b6-a99c-4751ef04fa54

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Jul 26, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces a new feature that changes how provider settings work - from primary-environment-only to per-environment configuration. It includes a new UI component, new state management, and a behavioral change to instance deletion. New user-facing features warrant human review.

You can customize Macroscope's approvability policy. Learn more.

@colonelpanic8
colonelpanic8 force-pushed the feature/provider-environment-settings branch from e46b174 to 53279a4 Compare July 28, 2026 02:08
Comment thread apps/web/src/components/settings/SettingsPanels.tsx
@colonelpanic8
colonelpanic8 force-pushed the feature/provider-environment-settings branch from 5ab8761 to be176c3 Compare July 28, 2026 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant